package ils.web.action;

import java.util.Map;

import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.AbstractInterceptor;

public class LoginInterceptor extends AbstractInterceptor
{
    private static final long serialVersionUID = 1L;

    @Override
    public String intercept(ActionInvocation inv) throws Exception
    {
        Map<String, Object> session = inv.getInvocationContext().getSession();
        if(session.get("login") == null) return "login";
        else return inv.invoke();
    }
}
